/*******************************************************************************
filename      NamedVariantType.h
author        Craig Williams

Brief Description:
  Same as the VariantType, except a additional string can be associated with
    this container. This is very useful for Data Value pairs or similar.

  Name value is store and accessable through the member variable mName.

  See VariantType.h for more information.
*******************************************************************************/
#ifndef NAMED_VARIANT_TYPE_H
#define NAMED_VARIANT_TYPE_H

#include "VariantType.h"

class NamedVariantType : public VariantType
{
  public:
    NamedVariantType(void                                    );
    NamedVariantType(const CString &name, void           *val);
    NamedVariantType(const CString &name, bool           *val);
    NamedVariantType(const CString &name, bool            val);
    NamedVariantType(const CString &name, char           *val); // NOT a string. Pointer to 1 element
    NamedVariantType(const CString &name, char            val);
    NamedVariantType(const CString &name, unsigned char  *val); // NOT a string. Pointer to 1 element
    NamedVariantType(const CString &name, unsigned char   val);
    NamedVariantType(const CString &name, short          *val);
    NamedVariantType(const CString &name, short           val);
    NamedVariantType(const CString &name, unsigned short *val);
    NamedVariantType(const CString &name, unsigned short  val);
    NamedVariantType(const CString &name, int            *val);
    NamedVariantType(const CString &name, int             val);
    NamedVariantType(const CString &name, unsigned int   *val);
    NamedVariantType(const CString &name, unsigned int    val);
    NamedVariantType(const CString &name, long           *val);
    NamedVariantType(const CString &name, long            val);
    NamedVariantType(const CString &name, unsigned long  *val);
    NamedVariantType(const CString &name, unsigned long   val);
    NamedVariantType(const CString &name, float          *val);
    NamedVariantType(const CString &name, float           val);
    NamedVariantType(const CString &name, double         *val);
    NamedVariantType(const CString &name, double          val);
    NamedVariantType(const CString &name, long double    *val);
    NamedVariantType(const CString &name, long double     val);

    NamedVariantType(const CString &name, const char     *val); // C Style String
    NamedVariantType(const CString &name, const CString  &val);
    NamedVariantType(const CString &name, CString        *val);

    NamedVariantType(const CString &name, const VariantType &val);
    NamedVariantType(const NamedVariantType &rval);

      // Serialization functions
    CVector<unsigned char>  Pack(void) const;
    CVector<unsigned char> &Pack(CVector<unsigned char> &data) const;
    unsigned int Unpack(const CVector<unsigned char> &data, unsigned int start = 0);


    void    Print(void) const;

    CString mName;
};

#endif
